package com.zhuoli.service.springboot.configuration.controller;

import com.zhuoli.service.springboot.configuration.service.GetApplicationProperties1;
import com.zhuoli.service.springboot.configuration.service.GetApplicationProperties2;
import com.zhuoli.service.springboot.configuration.service.GetProfileProperties;
import com.zhuoli.service.springboot.configuration.service.GetZhuoLiProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhuoli
 * @Date: 2018/7/24 11:07
 * @Description:
 */
@RestController
@RequestMapping("/properties")
public class CustomPropertiesController {

    @Autowired
    private GetApplicationProperties1 getApplicationProperties1;

    @Autowired
    private GetApplicationProperties2 getApplicationProperties2;

    @Autowired
    private GetZhuoLiProperties getZhuoLiProperties;

    @Autowired
    private GetProfileProperties getProfileProperties;

    @RequestMapping(value = "/get1", method = RequestMethod.GET)
    public String getCustomProperties1() {
        return getApplicationProperties1.toString();
    }

    @RequestMapping(value = "/get2", method = RequestMethod.GET)
    public String getCustomProperties2() {
        return getApplicationProperties2.toString();
    }

    @RequestMapping(value = "/get3", method = RequestMethod.GET)
    public String getZhuoLiProperties() {
        return getZhuoLiProperties.toString();
    }

    @RequestMapping(value = "/get4", method = RequestMethod.GET)
    public String getProfileProperties() {
        return getProfileProperties.toString();
    }
}
